﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ExtBusiness.FlowOperation;

public partial class MyWindow_suspend_add : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        HandleCaseService handlecase = new HandleCaseService();
        String ReturnPage = Session["ReturnPage"] != null ? Session["ReturnPage"].ToString() : "";//得到页面
        String s_userid = UserId;//用户id	
        String id = Request["id"];//业务编号	
        String s_gwId = Request["s_gwId"];//岗位id
        String s_memo = Request["s_gqInfo"];//挂起原因
        string Wname = string.Empty;
        String s_suspentype = Request["suspend_type"];//挂起类型

        String s_id = Request["s_id"];//唯一ID号自增长
        String s_gwname = "";
        //获得当前时间				
        String s_type = Request["type"];//动作类型

        String jsHtml = "";

        int nextUserStepNo = -1;
        // 添加业务删除标识条件 and i.isdelete <>1
        Wname = handlecase.GetWnameByCondi(id);

        try
        {
            handlecase.HandleOperate(UserId, Wname, s_userid, ref id, ref s_gwId, ref s_memo, Wname, ref s_suspentype, s_id, ref s_gwname, s_type, ref jsHtml, ref nextUserStepNo);
            Response.Write(jsHtml);
            handlecase.OperatSuspend_Add(id, Wname, s_id, s_type, nextUserStepNo);

            Response.Write("<script type=\"text/javascript\">");
            Response.Write("alert(\"操作成功!\");");
            if (s_type.Equals("gqsq"))//挂起申请
            {
                Response.Write("document.location = '" + ReturnPage + "';");
            }
            else if (s_type.Equals("jcgq"))
            {
                Response.Write("document.location = \"../xnjc/suspend_query.aspx?flag=jcgq\";");
            }
            else if (s_type.Equals("pzgq"))
            {
                Response.Write("document.location = \"../xnjc/suspend_query.aspx?flag=nogq\";");
            }
            else if (s_type.Equals("qxsq") || s_type.Equals("sqjg"))
            {
                Response.Write("document.location = '../mywindow/del_suspend_query.aspx';");
            }
            Response.Write("</script>");
        }
        catch
        {
            Response.Write("<script type=\"text/javascript\">alert(\"输入数据异常，请检查后重试!\");</script>");
        }
    }
}